import request from './request.js'
import { Decrypt } from '@/utils/aes.js'


//查询微信支付
export function queryOrderWithWx(orderNummber){
    return request({
        url:'/api/vip/wxpay/queryOrder',
        method:'GET',
        params:orderNummber,
        headers:{
            // 本地保存的accessToken
            'Authorization': Decrypt(localStorage.getItem('token')),
        }
    })
}

//查询阿里支付
export function queryOrderWithAli(orderNummber){
    return request({
        url:'/api/vip/alipay/queryOrder',
        method:'GET',
        params:orderNummber,
        headers:{
            // 本地保存的accessToken
            'Authorization': Decrypt(localStorage.getItem('token')),
        }
    })
}

//去结算
export function settlement(params){
    return request({
        url:'/api/order/settlement',
        method:'POST',
        data:params,
        headers:{
            // 本地保存的accessToken
            'Authorization': Decrypt(localStorage.getItem('token')),
        }
    })
}

//微信支付
export function wxpay({courses,payModes}){
    return request({
        url:'/api/pay/wxpay/createOrder',
        method:'POST',
        data:{courses,payModes},
        headers:{
            // 本地保存的accessToken
            'Authorization': Decrypt(localStorage.getItem('token')),
        }
    })
}

//查询微信支付
export function queryOrderWithWxx(orderNummber){
    return request({
        url:'/api/pay/wxpay/queryOrder',
        method:'GET',
        params:orderNummber,
        headers:{
            // 本地保存的accessToken
            'Authorization': Decrypt(localStorage.getItem('token')),
        }
    })
}


